package com.yanqu.road.entity.activity;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.Objects;

@FieldTypeAnnotation(tableName = "t_c_activity_union_task")
public class UnionActivityTaskData extends DataObject {

    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;
    @FieldTypeAnnotation(desc = "商会UID", select = true, update = true)
    private String unionUid = "";
    @FieldTypeAnnotation(desc = "任务ID", select = true, update = true)
    private int conditionId;
    @FieldTypeAnnotation(desc = "任务进度值")
    private long value;

    public UnionActivityTaskData() {
    }

    public UnionActivityTaskData(int activityId, String unionUid, int conditionId, long value) {
        this.activityId = activityId;
        this.conditionId = conditionId;
        this.unionUid = unionUid;
        this.value = value;
    }

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setUpdateOption();
        }
    }

    public void setUnionUid(String unionUid) {
        if (!Objects.equals(this.unionUid, unionUid)) {
            this.unionUid = unionUid;
            setUpdateOption();
        }
    }

    public void setConditionId(int conditionId) {
        if (this.conditionId != conditionId) {
            this.conditionId = conditionId;
            setUpdateOption();
        }
    }

    public void setValue(long value) {
        if (this.value != value) {
            this.value = value;
            setUpdateOption();
        }
    }

    public int getActivityId() {
        return activityId;
    }

    public String getUnionUid() {
        return unionUid;
    }

    public int getConditionId() {
        return conditionId;
    }

    public long getValue() {
        return value;
    }
}
